package com.bzyd.shiro;

import com.bzyd.shiro.common.Constant;
import org.apache.shiro.crypto.hash.SimpleHash;

import java.util.UUID;

public class GeneratePassword {
    public static void main(String[] args) {
        String password = "123456";
        String salt = UUID.randomUUID().toString().replace("-","");
        System.out.println("盐：" + salt);
        SimpleHash sh = new SimpleHash(Constant.HASH_ALGORITHMNAME, password, salt, Constant.HASH_ITERATIONS);
        String _password = sh.toHex();
        System.out.println("密码：" + _password);
    }
}
